#!/bin/bash
#
IO=$(mysql -uroot -pWWW.1.com 2>/dev/null -e "show slave status\G" | grep "Slave_IO_Running"| awk -F: '{print $2}')
SQL=$(mysql -uroot -pWWW.1.com 2>/dev/null -e "show slave status\G" | grep "Slave_SQL_Runnin" | awk -F: '{print $2}' | head -n 1)

if [ "${IO}" == " Yes" ];then
    echo "1"
else
    echo "0"
fi

if [ "${SQL}" == " Yes" ];then
    echo "1"
else
    echo "0"
fi
